package com.yuwubao.hz_International.config

import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.stereotype.Component
import org.springframework.web.bind.annotation.CrossOrigin
import springfox.documentation.builders.RequestHandlerSelectors
import springfox.documentation.spi.DocumentationType
import springfox.documentation.spring.web.plugins.Docket

@Component
@Configuration
open class SwaggerConf {
    @Bean
    open fun swConf():Docket{
        return Docket(DocumentationType.SWAGGER_2)
                .groupName("apis")
                .select()
                .apis(RequestHandlerSelectors.withClassAnnotation(CrossOrigin::class.java))
                .build()
    }
}